<template>
	<view class="container">
		<!-- <view>
			<navigator url="./change_pass" hover-class="none" class="cell">
				<view class="left">
					<image src="../../../static/icon/mima-2@2x.png" mode=""></image>
					<text>修改密码</text>
				</view>
				<image class="icon" src="../../../static/img/fanhui.png" mode=""></image>
			</navigator>
		</view> -->
		<!-- <view class="cell">
			<view class="left">
				<image src="../../../static/icon/huancun@2x.png" mode=""></image>
				<text>清除缓存</text>
			</view>
			<image class="icon" src="../../../static/img/fanhui.png" mode=""></image>
		</view> -->
		<navigator url="./about" hover-class="none" class="cell">
			<view class="left">
				<image src="../../../static/icon/guanyuwomen.png" mode=""></image>
				<text>关于我们</text>
			</view>
			<image class="icon" src="../../../static/img/fanhui.png" mode=""></image>
		</navigator>
		<navigator url="./privacy" hover-class="none" class="cell">
			<view class="left">
				<image src="../../../static/icon/tuijian.png" mode=""></image>
				<text>相关协议</text>
			</view>
			<image class="icon" src="../../../static/img/fanhui.png" mode=""></image>
		</navigator>
		<view>
			<navigator class="cell" url="../set/feedback" hover-class="none">
				<view class="left">
					<image src="../../../static/icon/tuijian.png" mode=""></image>
					<text>帮助与反馈</text>
				</view>
				<image class="icon" src="../../../static/img/fanhui.png" mode=""></image>
			</navigator>
		</view>
		<view class="loginout" @click="loginout()">
			退出登录
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				token: "",
			}
		},
		created() {
			uni.getStorage({
				key: 'user_info',
				success: (res) => {
					this.token = res.data.token;
				}
			});
		},
		methods: {
			loginout() {
				setTimeout(()=>{
					uni.redirectTo({
						url: '../../login/auth'
					});
				},1000)
				// uni.request({
				// 	url: 'https://mx.acktechnologies.com.cn/api/user/logout',
				// 	data: {
				// 		"token": this.token
				// 	},
				// 	method: 'GET',
				// 	success: res => {
				// 		if (res.data.code === 1) {
				// 			uni.showToast({
				// 				title: res.data.msg,
				// 				duration: 2000,
				// 				icon: 'none',
				// 			});
				// 			uni.removeStorage({
				// 				key: 'user_info',
				// 				success: function(res) {
				// 					console.log('success');
				// 				}
				// 			});
				// 			setTimeout(()=>{
				// 				uni.redirectTo({
				// 					url: '../../login/auth'
				// 				});
				// 			},1000)
				// 		} else {
				// 			uni.showToast({
				// 				title: res.data.msg,
				// 				duration: 2000,
				// 				icon: 'none',
				// 			});
				// 		}
				// 		console.log(res)
				// 	},
				// 	fail: (res) => {
				// 		console.log(res)
				// 	},
				// 	complete: (res) => {
				// 		console.log(res)
				// 	}
				// });
			}
		}
	}
</script>

<style scoped lang="scss">
	.container {
		padding: 0 40rpx;
	}

	.cell {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		height: 126rpx;

		.left {
			display: flex;
			flex-direction: row;
			align-items: center;

			image {
				width: 34rpx;
				height: 32rpx;
			}

			text {
				font-size: 15px;
				color: #333333;
				margin-left: 20rpx;
			}
		}

		.icon {
			width: 12rpx;
			height: 20rpx;
		}
	}

	.loginout {
		width: 670rpx;
		height: 96rpx;
		line-height: 96rpx;
		background: #FFFFFF;
		border-radius: 48rpx;
		border: 1px solid #C9C8C8;
		font-size: 18px;
		color: #999999;
		text-align: center;
		margin-top: 20vh;
	}
</style>
